import {request} from '@/apis';
import {addPrefix} from '@/utils/helper';
import {type CarbonReductionParams} from './types';

const prefixUrl = '/ep-query';

const Api = {
  getCarbonReductionYear: '/getYear',
  getCarbonReduction: '/getCarbonReduction',
  getCarbonQuotaList: '/v2/hbSubject/getHbSubject',
  getCarbonQuotaDepartment: '/screen/carbonEmissionDepartment',
  /** esg数据获取 */
  GET_ESG: '/getEsg',
  /** esg市场获取 */
  GET_MARKET_CODE: '/screen/marketCode',
  /** esg指数成分股获取 */
  GET_INDEX_CODE: '/screen/indexCode',
  /** esg币种获取 */
  GET_CURRENCY_CODE: '/screen/currencyCode',
  /** esg环境指标 */
  GET_ENVIRONMENT_INDICATOR: '/screen/esgEnvironmentalIndicator',
  /** ESG行业筛选数据获取 */
  GET_ESG_INDUSTRY: '/screen/esgIndustryCategory',
  /** esg环境年份筛选 */
  GET_ESG_YEAR: '/getTagYear',
  /** 履约情况列表获取 */
  GET_APPOINTMENT: '/screen/appointmentType',


};

addPrefix(Api, prefixUrl);

export * from './types';

/** 获取碳减排数据年度 */
export const getCarbonReductionYear = () => request.get({url: Api.getCarbonReductionYear});

/** 获取碳减排数据 */
export const getCarbonReduction = (params: CarbonReductionParams) => request.get({
  url: Api.getCarbonReduction,
  params
});


/** 获取碳配额企业列表 */
export const getCarbonQuotaList = (params) => request.get({url: Api.getCarbonQuotaList, params});

/** 获取碳市场等级筛选 */
export const getCarbonQuotaDepartment = (params) => request.get({
  url: Api.getCarbonQuotaDepartment,
  params
});

/** ESG列表数据获取 */
export const getEsg = (params) => request.post({url: Api.GET_ESG, params});
/** ESG市场筛选数据获取 */
export const getMarketCode = (params) => request.get({url: Api.GET_MARKET_CODE, params});
/** ESG指数成分股获取 */
export const getIndexCode = (params) => request.get({url: Api.GET_INDEX_CODE, params});
/** ESG币种获取 */
export const getCurrencyCode = (params) => request.get({url: Api.GET_CURRENCY_CODE, params});
/** ESG环境指标获取 */
export const getEsgIndicators = (params) => request.get({
  url: Api.GET_ENVIRONMENT_INDICATOR,
  params
});

/** ESG行业筛选数据 */
export const getEsgIndustry = (params) => request.get({url: Api.GET_ESG_INDUSTRY, params});

/** ESG年份获取 */
export const getEsgYear = (params) => request.get({
  url: Api.GET_ESG_YEAR,
  params
});

/** 履约情况列表获取 */
export const getAppointment = (params) => request.get({
  url: Api.GET_APPOINTMENT,
  params
});

